using NUnit.Framework;
using RMH.DataAccess;
using RMH.Entities;
using RMH.Services;

namespace RMH.UnitTests.Services
{
    [TestFixture]
    public class BaseServices_when_getting_a_patient_by_id : base_automock_test
    {
        private Patient patient = new Patient { Id = 2 };
        private Patient returnedPatient = new Patient {Id = 2};
        private int patientId = 2;

        public override void establish_context()
        {
            Mock<IPatientRepository>()
                .Setup(r => r.GetByID(2))
                .Returns(returnedPatient);
        }
        public override void because()
        {
            returnedPatient = Create<PatientService>().Get(patientId);
        }
        
        [Test]
        public void returns_a_patient_from_the_repository()
        {
            returnedPatient.ShouldEqual(patient);
        }
    }
}